package com.字节流读数据FileInPutStream;

import lombok.SneakyThrows;

import java.io.FileInputStream;

/*
读数据 一次读取一个字节数组
 */
public class Demo03 {
    @SneakyThrows
    public static void main(String[] args) {
        FileInputStream fileInputStream = new FileInputStream("hello.txt");

        byte[] bytes = new byte[1024];
        int by;
        while ((by=fileInputStream.read(bytes))!=-1){
            System.out.print(new String(bytes,0,by));
        }
    }
}
